Skip to content

Docs: imported pages no longer print their import comment; build fails on raw syntax - #222

Merged
nambok merged 1 commit into
mainfrom
docs/fix-import-comment
Oct 26, 2026
Merged

nambok merged 1 commit into
mainfrom
docs/fix-import-comment

Conversation

@nambok

@nambok nambok commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Every imported self-host page (for example /self-host/backups/ and /self-host/email/) showed the literal text {/* Imported from CoderHelm/coderhelm-platform/docs/self-host/... Edit it there. */} under its title. The importer wrote an MDX comment into files it saves as .md, which are rendered as Markdown, so the comment printed as text. This writes the same information as front matter instead, and adds a build check that fails on raw syntax showing on any page.

Changes

  • scripts/import-platform.mjs: imported guides get source (repo and path) and sourceCommit (the pinned commit) front matter instead of the body comment. editUrl still points "Edit on GitHub" and "Open in GitHub" at the guide's file in coderhelm-platform.
  • lib/source.ts: the page schema accepts source and sourceCommit.
  • scripts/lib/raw-syntax.mjs (new): extracts a built page's visible text (without scripts, styles, pre, code and kbd) and finds an MDX comment ({/*, */}), a component tag printed as text (<Callout, <Tabs, <Steps, <Diagram and the rest), an escaped brace, an admonition marker (:::note, [!NOTE]) or a double-escaped entity.
  • scripts/check-output.mjs: runs that check on every exported page, and on every Markdown twin outside code. Component tags in the twins are allowed, since they are kept there on purpose.
  • Tests: scripts/raw-syntax.test.mjs (new) and a new importer test that says the body has no comment.

Verification

  • npm run test:unit: 75 tests pass.
  • Re-imported at the current lock (22548c6e2333). No {/* remains in content/docs/self-host/ or in any built .md twin or llms-full.txt.
  • Build OK, then check:output OK (88 pages) and check:links OK (4163 links, none broken). typecheck OK.
  • The new check catches the live bug. Running it on the current production HTML of /self-host/backups/ reports mdx-comment: ... Copy Markdown Open {/* Imported from CoderHelm/coderhelm-platf....

…d fails on raw syntax

The importer put an MDX comment under each imported self-host page's front
matter. Those pages are Markdown, so the comment printed under the title.
It now writes source and sourceCommit front matter instead. check:output
reads every built page's visible text (and each Markdown twin outside code)
and fails on an MDX comment, a component tag printed as text, an escaped
brace, an admonition marker or a double-escaped entity.
@nambok
nambok merged commit 51b1ba8 into main Oct 26, 2026
5 checks passed
@nambok
nambok deleted the docs/fix-import-comment branch October 26, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant